﻿<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body style="background-color: rgb(248, 246, 242);">

    <div id="main" class="container-fluid">
        <br />
        <div class="panel panel-default">
            <div class="panel-heading">新增任务[]</div>
            <div class="panel-body">
                <form method="POST" data-ajax="true"
                      data-ajax-url="/job/save"
                      data-ajax-method="POST" data-ajax-begin="Page.onPostBegin"
                      data-ajax-complete="Page.onPostComplete">
                    <input type="hidden" name="id" value="" /> <input type="hidden" name="jobType" value="http" />

                    <div class="row">
                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="name">任务名称</label> <span class="field-validation-valid text-danger"
                                                                     data-valmsg-for="name" data-valmsg-replace="true"></span> <input class="form-control" data-val="true"
                                                                                                                                      data-val-length="任务名称不能大于50个字符" data-val-length-max="50"
                                                                                                                                      data-val-required="任务名称不能为空" id="name" name="name"
                                                                                                                                      placeholder="输入调度任务名称" type="text" value=""
                                                                                                                                      required="required" data-val="true" data-val-required="不能为空" />
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="groupId">选择分组</label> <span class="field-validation-valid text-danger"
                                                                        data-valmsg-for="groupId" data-valmsg-replace="true"></span>
                                <select class="form-control" name="groupId"
                                        required="required" data-val="true" data-val-required="不能为空">

                                    <optgroup label="===测试分组==="></optgroup>

                                    <option value="29">
                                        测试1
                                    </option>


                                    <optgroup label="===微信项目==="></optgroup>

                                    <option value="50">
                                        鲜花项目
                                    </option>


                                    <optgroup label="===配送对接系统==="></optgroup>

                                    <option value="35">
                                        EDI.JOB
                                    </option>

                                    <option value="56">
                                        菜鸟对接
                                    </option>

                                    <option value="8">
                                        小米对接
                                    </option>

                                    <option value="65">
                                        飞牛网
                                    </option>

                                    <option value="11">
                                        亚马逊
                                    </option>

                                    <option value="72">
                                        OTMS
                                    </option>

                                    <option value="97">
                                        WMS
                                    </option>

                                    <option value="59">
                                        淘宝-天猫
                                    </option>

                                    <option value="93">
                                        环球购物
                                    </option>

                                    <option value="66">
                                        家有购物
                                    </option>


                                    <optgroup label="===客户关系管理系统==="></optgroup>

                                    <option value="53">
                                        运费时效
                                    </option>

                                    <option value="20">
                                        大工单
                                    </option>


                                    <optgroup label="===运输管理系统==="></optgroup>

                                    <option value="38">
                                        分拣报表
                                    </option>

                                    <option value="90">
                                        TMS监控
                                    </option>

                                    <option value="62">
                                        分拣业务调度
                                    </option>


                                    <optgroup label="===配送数据处理系统==="></optgroup>

                                    <option value="32">
                                        订单监控
                                    </option>

                                    <option value="96">
                                        飞牛网对接
                                    </option>

                                    <option value="75">
                                        DPS接口调度
                                    </option>


                                    <optgroup label="===仓库管理系统==="></optgroup>

                                    <option value="84">
                                        小米光速达
                                    </option>


                                    <optgroup label="===大数据==="></optgroup>

                                    <option value="44">
                                        数据采集服务
                                    </option>

                                    <option value="81">
                                        bi-job邮件统计
                                    </option>

                                    <option value="69">
                                        bi-job
                                    </option>

                                    <option value="78">
                                        bi-风火轮
                                    </option>

                                    <option value="87">
                                        云平台
                                    </option>


                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="method">Http Method</label> <span class="field-validation-valid text-danger"
                                                                              data-valmsg-for="method" data-valmsg-replace="true"></span>
                                <div class="input-group">
                                    <input id="txtHttpMethod" type="text" name="method"
                                           value="" class="form-control"
                                           aria-label="..." required="required" data-val="true"
                                           data-val-required="不能为空" data-val-regex="必须是3-10个大写字母"
                                           data-val-regex-pattern="[A-Z]{3,10}">
                                    <div class="input-group-btn">
                                        <button type="button"
                                                class="btn btn-default dropdown-toggle"
                                                data-toggle="dropdown" aria-haspopup="true"
                                                aria-expanded="false">
                                            选择 <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right">
                                            <li><a href="javascript:Page.selectHttpMethod('GET')">GET</a></li>
                                            <li><a href="javascript:Page.selectHttpMethod('POST')">POST</a></li>
                                            <li role="separator" class="divider"></li>
                                            <li><a href="javascript:Page.selectHttpMethod('PUT')">PUT</a></li>
                                            <li><a href="javascript:Page.selectHttpMethod('HEAD')">HEAD</a></li>
                                            <li>
                                                <a href="javascript:Page.selectHttpMethod('DELETE')">DELETE</a>
                                            </li>
                                            <li>
                                                <a href="javascript:Page.selectHttpMethod('OPTIONS')">OPTIONS</a>
                                            </li>
                                            <li>
                                                <a href="javascript:Page.selectHttpMethod('PATCH')">PATCH</a>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- /btn-group -->
                                </div>
                                <!-- /input-group -->
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="timeOut">超时时间(秒)</label> <span class="field-validation-valid text-danger"
                                                                           data-valmsg-for="timeOut" data-valmsg-replace="true"></span>
                                <input class="form-control" data-val="true"
                                       data-val-number="必须是一个数字，单位秒。" data-val-required="不能为空"
                                       id="timeOut" name="timeOut" placeholder="执行超时时间（秒）"
                                       type="text" value="" />
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="cron">执行频率</label> <span class="field-validation-valid text-danger"
                                                                     data-valmsg-for="cron" data-valmsg-replace="true"></span>
                                <div class="input-group">
                                    <input class="form-control" data-val="true"
                                           data-val-length="任务名称不能大于100个字符" data-val-length-max="100"
                                           data-val-required="执行频率不能为空" id="cron" name="cron"
                                           placeholder="输入整数或者Cron表达式" type="text"
                                           value="" /> <span class="input-group-btn">
                                        <button id="btnViewCorn" type="button"
                                                class="btn btn-default" data-container="body"
                                                data-toggle1="popover" data-placement1="left"
                                                data-content1="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
                                            Cron示例
                                        </button>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="resultRegex">成功标识正则</label> <span class="field-validation-valid" data-valmsg-for="resultRegex"
                                                                              data-valmsg-replace="true"></span>
                                <div class="input-group">
                                    <input class="form-control" id="resultRegex"
                                           name="resultRegex" placeholder="调度成功标识正则表达式" type="text"
                                           value="" /> <span class="input-group-btn">
                                        <button id="btnViewRegex" type="button"
                                                class="btn btn-default">
                                            正则表达式
                                        </button>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label for="url">执行地址</label> <span class="field-validation-valid text-danger"
                                                                    data-valmsg-for="url" data-valmsg-replace="true"></span> <input class="form-control" data-val="true"
                                                                                                                                    data-val-regex="Http(s)地址不正确"
                                                                                                                                    data-val-regex-pattern="((http|https)://)(.+)"
                                                                                                                                    data-val-required="任务地址不能为空" id="url" name="url"
                                                                                                                                    placeholder="输入调度任务Http地址" type="text"
                                                                                                                                    value="" />
                            </div>
                        </div>
                        <div class="col-md-6 col-lg-12">
                            <div class="form-group">
                                <label for="header">Http Header</label> <span class="field-validation-valid" data-valmsg-for="header"
                                                                              data-valmsg-replace="true"></span>
                                <textarea class="form-control" cols="20" id="header"
                                          name="header" placeholder="输入调度任务HttpHeader信息" rows="3"></textarea>
                            </div>
                        </div>
                        <div class="col-md-6 col-lg-12">
                            <div class="form-group">
                                <label for="content">Http Body</label> <span class="field-validation-valid" data-valmsg-for="content"
                                                                             data-valmsg-replace="true"></span>
                                <textarea class="form-control" id="content" name="content"
                                          placeholder="输入 Http 内容" rows="3"></textarea>
                            </div>
                        </div>
                        <div class="col-lg-12">
                            <div class="form-group">
                                <label for="describe">任务描述</label> <span class="field-validation-valid" data-valmsg-for="describe"
                                                                         data-valmsg-replace="true"></span>
                                <textarea class="form-control" id="describe" name="describe"
                                          placeholder="输入调度任务描述" rows="3"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="row hidden">
                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="startAt">开始时间</label> <span class="small">(为空代表立即开始)</span>
                                <div id="datetimepicker"
                                     class=" input-group date form_datetime"
                                     data-date1="1979-09-16T05:25:07Z"
                                     data-date-format="dd MM yyyy - HH:ii p"
                                     data-link-field="dtp_input1">
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-th"></span>
                                    </span> <input class="form-control" data-val="true"
                                                   data-val-date="字段 开始时间 必须是日期。" id="startAt" name="startAt"
                                                   placeholder="点击输入开始时间" type="text" value="" /> <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-remove"></span>
                                    </span>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6 col-md-4 col-lg-3">
                            <div class="form-group">
                                <label for="endAt">结束时间</label> <span class="small">(为空代表永不结束)</span>
                                <div id="datetimepicker"
                                     class=" input-group date form_datetime"
                                     data-date1="1979-09-16T05:25:07Z"
                                     data-date-format="dd MM yyyy - HH:ii p"
                                     data-link-field="dtp_input1">
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-th"></span>
                                    </span> <input class="form-control" data-val="true"
                                                   data-val-date="字段 结束时间 必须是日期。" id="endAt" name="endAt"
                                                   placeholder="点击输入结束时间" type="text" value="" /> <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-remove"></span>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-primary btn-block">提交保存</button>

                    <div class="validation-summary-valid" data-valmsg-summary="true">
                        <ul>
                            <li style="display: none"></li>
                        </ul>
                    </div>
                </form>

            </div>
        </div>

    </div>
    <script id="tplCorn" type="text/template">
        <p>
            格式：秒 分 时 日 月 周 年(可选)
        </p>
        <pre style="font-size:9pt;">
每隔5秒执行一次：*/5 * * * * ?
每隔1分钟执行一次：0 */1 * * * ?
每天23点执行一次：0 0 23 * * ?
每天凌晨1点执行一次：0 0 1 * * ?
每月1号凌晨1点执行一次：0 0 1 1 * ?
每月最后一天23点执行一次：
0 0 23 L * ?
每周星期天凌晨1点实行一次：
0 0 1 ? * L
在26分、29分、33分执行一次：
0 26,29,33 * * * ?
每天的0,13,18,21点都执行一次：
0 0 0,13,18,21 * * ?
</pre>
    </script>

    <div id="alertModel" class="modal fade bs-example-modal-sm"
         tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"
         data-backdrop="static" data-show="true" data-keyboard="false">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">model.result.name</h4>
                </div>
                <div class="modal-body">
                    <h4>model.message</h4>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <a class="btn btn-primary" href="/job/list/">返回任务列表</a>
                </div>
            </div>
        </div>
    </div>



    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>